package com.mtgdeckbuilder.client;

import java.util.List;

import com.google.gwt.user.client.rpc.AsyncCallback;
import com.mtgdeckbuilder.shared.dto.CardDTO;

/**
 * The asynchronous counterpart of <code>CardService</code>.
 * 
 * @author Nicolas Deslandes
 */
public interface CardServiceAsync {

   /**
    * Query from the database a list of cards with arguments and limit the returned objects.
    * 
    * @param args the object that contains the arguments of the query.
    * @param limit the limit of returned objects (0 if unlimited)
    * @param callback the asynchronous callback that contains the list of found cards.
    */
   void queryDatabase(CardDTO args, int limit, AsyncCallback<List<CardDTO>> callback);

   /**
    * Query from a Magic source a list of cards with arguments and limit the returned objects.
    * 
    * @param args the object that contains the arguments of the query.
    * @param limit the limit of returned objects (0 if unlimited)
    * @param callback the asynchronous callback that contains the list of found cards.
    */
   void queryMagicSource(CardDTO args, int limit, AsyncCallback<List<CardDTO>> callback);

}
